package com.novoda.runbuddy.provider;

import android.net.Uri;
import android.provider.BaseColumns;

public final class RunBuddyCP {

	public static final class Routes implements BaseColumns {
		public static final Uri		CONTENT_URI			= Uri.parse("content://com.novoda.runbuddy/routes");

		public static final String	LONGITUDE			= "longitude";

		public static final String	LATITUDE			= "latitude";

		public static final String	NAME				= "name";

		public static final String	SERVER_ID			= "__id";

		public static final String	CREATED_DATE		= "createdAt";

		public static final String	MODIFIED_DATE		= "modifiedAt";

		public static final String	DEFAULT_SORT_ORDER	= "route.name DESC";
	}

	public static final class RoutePoints implements BaseColumns {
		public static final Uri		CONTENT_URI			= Uri.parse("content://com.novoda.runbuddy/routes/#/points");

		public static final String	LONGITUDE			= "longitude";

		public static final String	LATITUDE			= "latitude";

		// This is discovered from the Uri itself... No need to be explicit
		//public static final String	_ROUTE_ID			= "_idRoute";

		public static final String	ALGORITHM			= "algorithm";

		public static final String	DIRECTION			= "direction";

		public static final String	POINT_NO			= "pointNo";

		public static final String	CREATED_DATE		= "createdAt";

		public static final String	MODIFIED_DATE		= "modifiedAt";

		public static final String	DEFAULT_SORT_ORDER	= "routePoint.pointNo DESC";
	}

	public static final class RouteSegments implements BaseColumns {
		public static final Uri		CONTENT_URI			= Uri.parse("content://com.novoda.runbuddy/route/#/segments");

		// TODO if you need this let me know
		public static final String	_CHECKPOINT_ID		= "_idCheckPoint";

		// TODO if you need this let me know
		public static final String	_ROUTE_ID			= "_idRoute";

		public static final String	CHECKPOINT_NO		= "checkPointNo";

		public static final String	DISTANCE			= "distance";

		public static final String	DEFAULT_SORT_ORDER	= "checkPointNo DESC";
	}

	public static final class Runs implements BaseColumns {
		public static final Uri		CONTENT_URI			= Uri.parse("content://com.novoda.runbuddy/runs");

		// this is taken from the Uri
		//public static final String	_ROUTE_ID			= "_idRoute";

		public static final String	NAME				= "name";

		public static final String	TOTAL_TIME			= "totalTime";

		public static final String	CREATED_DATE		= "createdAt";

		public static final String	MODIFIED_DATE		= "modifiedAt";

		public static final String	DEFAULT_SORT_ORDER	= "createdAt DESC";
	}

	public static final class RunSegments implements BaseColumns {
		public static final Uri		CONTENT_URI			= Uri.parse("content://com.novoda.runbuddy/run/#/segments");

		// this is taken from the URI
		//public static final String	_RUN_ID				= "_idRun";

		/*
		 * In order to get the checkpoint, you would query content://<>/routes/#/checkpoints
		 * 
		 * We could also use content://<>/run/#/checkpoints
		 * 
		 * Then use the checkPoinNo to get the actual checkpoint (with lat/long)
		 */
		//public static final String	_CHECKPOINT_ID		= "_idCheckPoint";

		public static final String	CHECKPOINT_NO		= "checkPointNo";

		public static final String	TIME				= "time";

		public static final String	LAP					= "lap";

		public static final String	CREATED_DATE		= "created";

		public static final String	MODIFIED_DATE		= "modified";

		public static final String	DEFAULT_SORT_ORDER	= "checkPointNo DESC";
	}

	public static final class GeoLocations implements BaseColumns {
		public static final Uri		CONTENT_URI			= Uri.parse("content://com.novoda.runbuddy/geolocations");

		public static final String	NAME				= "name";

		public static final String	ADDRESS_1			= "address1";

		public static final String	ADDRESS_2			= "address2";

		public static final String	ALTITUDE			= "altitude";

		public static final String	COUNTRY_CODE		= "countryCode";

		public static final String	LONGITUDE			= "longitude";

		public static final String	LATITUDE			= "latitude";

		public static final String	POSTCODE			= "postCode";

		public static final String	CREATED_DATE		= "createdAt";

		public static final String	MODIFIED_DATE		= "modifiedAt";

		public static final String	DEFAULT_SORT_ORDER	= "name DESC";
	}

	public static final class CheckPoints implements BaseColumns {
		public static final Uri		CONTENT_URI			= Uri.parse("content://com.novoda.runbuddy/checkpoints");

		public static final String	ALTITUDE			= "altitude";

		public static final String	LONGITUDE			= "longitude";

		public static final String	LATITUDE			= "latitude";

		public static final String	SERVER_ID			= "__id";

		public static final String	NAME				= "name";

		public static final String	DESCRIPTION			= "description";

		public static final String	IMPLEMENTOR			= "implementor";

		public static final String	CREATED_DATE		= "createdAt";

		public static final String	MODIFIED_DATE		= "modifiedAt";

		public static final String	DEFAULT_SORT_ORDER	= "name DESC";
	}
}
